<script setup lang="ts">
// Main此组件主要为公用视图组件
</script>

<template>
  <div>
    <RouterView v-slot="{ Component, route }">
      <transition name="transitionName" mode="in-out">
        <keep-alive>
          <component :is="Component" v-if="route.meta.keepAlive" />
        </keep-alive>
      </transition>
      <transition name="transitionName" mode="out-in">
        <component :is="Component" v-if="!route.meta.keepAlive" />
      </transition>
    </RouterView>
  </div>
</template>

<style scoped lang="less">
.transitionName-enter-active {
  transition: all 0.25s ease;
}
.transitionName-leave-active {
  transition: all 0.5s cubic-bezier(1, 0.5, 0.8, 1);
}
.transitionName-enter-from,
.transitionName-leave-to {
  transform: translateX(7px);
  opacity: 0;
}
</style>
